<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>考神驾到手机站试题统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/public.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/windowsheight.js"></script>

    <script src="${pageContext.request.contextPath}/manager_page/layui/layui.js"></script>

    <script src="${pageContext.request.contextPath}/highchart/code/highcharts.js"></script>
    <script src="${pageContext.request.contextPath}/highchart/code/highcharts-3d.js"></script>
<%--    <script src="${pageContext.request.contextPath}/highchart/code/modules/exporting.js"></script>--%>
<%--    <script src="${pageContext.request.contextPath}/highchart/code/modules/export-data.js"></script>--%>
<%--    <script src="${pageContext.request.contextPath}/highchart/code/modules/accessibility.js"></script>--%>
</head>

<body>
<!-----------头部开始--------------->
<%@ include file="page_head.jsp"%>
<!-----------头部结束--------------->
<!-----------内容开始--------------->
 <div class="content">

     <div class="newdetailcon">
         <div class="biaoti"><img src="images/libg_06.jpg"><span id="tongji_class">科一试题统计</span></div>
     </div>

<%--  <div class="tongimg" >--%>
<%--&lt;%&ndash;    <img src="images/tuoyuan_03.jpg"/>&ndash;%&gt;--%>
<%--      --%>

<%--  </div>--%>
    <div id="container" style="width: 100%;height: 80%;"></div>

  <div class="test_tongji">   
    <p class="rightcount">做对:<span id="right_num">0</span></p>
    <p class="errorcount">做错:<span id="error_num">0</span></p>
    <p class="notcount">未做:<span id="untest_num">0</span></p>
    <div class="clear"></div> 
   </div>
   <div class="testtitle">
         <div class="biaoti"><img src="images/libg_06.jpg"><p class="donepre">您已经做过 <b id="did_num">0</b> 题，占总题数的<b id="did_num_percent">0.0%</b></p></div>
         <div class="biaoti"><img src="images/libg_06.jpg"><p class="rightpre">您已经对了<b id="right_num_bottom">0</b> 题，占总题数的<b id="right_num_percent">0.0%</b></p></div>
         <div class="biaoti"><img src="images/libg_06.jpg"><p class="errorpre">您做错<b id="error_num_bottom">8</b>题，您的正确率为<b id="right_percent">0.0%</b></p></div>
   </div>

     <div class="pageturn">
         <div class="prepage"><a href="javascript:lastPage();">&lt; 上一页</a></div>
         <p><span><b id="current_page">1</b>/2</span></p>
         <div class="prepage"> <a href="javascript:nextPage();">下一页 &gt;</a></div>
     </div>

 </div>
 <!-----------内容结束--------------->
<%-- <div class="footer">--%>
<%--   <p>©考神驾到版权所有</p>--%>
<%--   <span>www.kaoshenjiadao.com</span>--%>
<%-- </div>--%>
 
</body>

<script>
    var layer;
    layui.use('layer',function(){
        layer=layui.layer;
    })
    var json={};

    $("#page_head_title").text("试题统计");

    window.onload=function(){
        initTongji_img("科一");
    }


    function lastPage(){
        var current_page=parseInt($("#current_page").text());
        if(current_page<=1){
            layer.msg("这已经是第一页了")
        }else{
            current_page--;
            $("#current_page").text(current_page);
            $("#tongji_class").text("科一试题统计");
            initTongji_img("科一");
        }
    }

    function nextPage(){
        var current_page=parseInt($("#current_page").text());
        if(current_page>=2){
            layer.msg("这已经是最后一页了")
        }else{
            current_page++;
            $("#current_page").text(current_page);
            $("#tongji_class").text("科四试题统计");
            initTongji_img("科四");
        }
    }

    function initTongji_img(question_class){
        $.ajax({
            url:"${pageContext.request.contextPath}/front_question/init_tongji_img.do",
            data:{
                "question_class":question_class
            },
            success:function (data,status){
                if(status=="success"){
                    //初始化统计图

                    var chart={
                        type: 'pie',
                        options3d: {
                            enabled: true,//3d效果
                            alpha: 45,
                            beta: 0
                        }
                    }
                    var title={
                        text: ''
                    }
                    // var accessibility={
                    //     point: {
                    //         valueSuffix: '%'
                    //     }
                    // }
                    var tooltip={
                        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                    }
                    var plotOptions={
                        pie: {
                            allowPointSelect: true,
                            cursor: 'pointer',
                            depth: 35,
                            dataLabels: {
                                enabled: true,
                                format: '{point.name}'
                            }
                        }
                    }

                    $("#right_num").text(data.pass_num);
                    $("#right_num_bottom").text(data.pass_num);
                    $("#error_num").text(data.fail_num);
                    $("#error_num_bottom").text(data.fail_num);
                    $("#untest_num").text(data.total_num-data.pass_num-data.fail_num);
                    $("#did_num").text(data.pass_num+data.fail_num);

                    var percent1=data.pass_num/data.total_num;
                    var percent2=data.fail_num/data.total_num;
                    percent1*=100;percent2*=100;
                    percent1=Math.round(percent1*10)/10;
                    percent2=Math.round(percent2*10)/10;
                    var did_num_percent=(data.pass_num+data.fail_num)/data.total_num;
                    did_num_percent*=100;
                    did_num_percent=Math.round(did_num_percent*10)/10;
                    $("#did_num_percent").text(did_num_percent+"%");
                    $("#right_num_percent").text(percent1+"%");
                    $("#right_percent").text(data.pass_percent+"%");
                    // alert(data.pass_num);
                    // alert(data.fail_num);
                    // alert(data.total_num);
                    var series=[{
                        type: 'pie',
                        name: question_class+'试题统计',
                        data: [

                            {
                                name: '做对',
                                y: percent1,
                                // sliced: true,
                                // selected: true,
                                color:"PaleGreen"
                            },
                            {
                                name: '做错',
                                y: percent2,
                                color:"Coral"
                            },
                            {
                                name: '未做',
                                y: 100-percent1-percent2,
                                color:"Silver"
                            }
                        ]
                    }]

                    json.chart = chart;
                    json.title = title;
                    json.tooltip = tooltip;
                    json.series = series;
                    json.plotOptions = plotOptions;
                    // json.accessibility=accessibility;
                    $('#container').highcharts(json);
                }
            }
        })
    }




</script>


<script>

    // json.chart = chart;
    // json.title = title;
    // json.tooltip = tooltip;
    // json.series = series;
    // json.plotOptions = plotOptions;
    // json.accessibility=accessibility;
    // $('#container').highcharts(json);
    //
    //
    // function changePercent(percent1,percent2){
    //
    //     var right={};
    //     var error={};
    //     var untest={};
    //
    //     right.name="做对";
    //     right.y=percent1;
    //     right.sliced=true;
    //     right.selected=true;
    //
    //     error.name="做错";
    //     error.y=percent2;
    //
    //     untest.name="未做";
    //     untest.y=100-right.y-error.y;
    //
    //     var data_tool=[];
    //     data_tool.push(right);
    //     data_tool.push(error);
    //     data_tool.push(untest);
    //
    //     json.series=[{
    //         type: 'pie',
    //         name: '科一试题统计',
    //         data: data_tool
    //     }]
    //
    //     $('#container').highcharts(json);
    // }

</script>




<!--头部高度赋给列表的topjs-->
<script>
   var heighttop=$(".top").height();
   $(".topmenu").css("top",heighttop);
    $(".menumore").toggle(function(){
	     $(".topmenu").show(); 
	   },function(){
	     $(".topmenu").hide(); 
	 	   })
   $(".buttontop").click(function(){
	     $(".topmenu").hide();  
	   })
	   
 $(function(){
	 $(".tasecartop span a").click(function(){
		  var $banktip=$(this).attr("tip");
		  $($banktip).show().siblings().hide();
		  $(".tasecartop span a").removeClass("payaclik");
		  $(this).addClass("payaclik");
		 })
	
	})
	/*模拟考试列表分类车型选择tab切换*/
 $(function(){
	 $(".test_onelist li a").click(function(){
		  var $banktip=$(this).attr("tip");
		  $($banktip).show().siblings().hide();
		  $(".test_onelist li a").removeClass("testcaraclick");
		  $(this).addClass("testcaraclick");
		 })
	
	})
	
 </script>
 
<!--头部高度赋给列表的topjs-->
<!--banner将图片的高度赋给父级扪js-->
<script>
   var heighta=$("#incltialiu li:eq(0) img").height();
   $(".main,.width,#incltialiu").height(heighta) ;
 </script>
 <!--banner将图片的高度赋给父级扪js-->
<!--首页标题点击出现更多分类js-->
 <script>
	$(".titlemore").toggle(function(){
		$(this).parent(".tabtila").siblings(".moresort").show()
		$(this).children("img").attr("src","images/title_692.jpg")
		},function(){
		$(this).parent(".tabtila").siblings(".moresort").hide()
		$(this).children("img").attr("src","images/title_69.jpg")
		})
  </script>
 <!--首页标题点击出现更多分类js-->
</html>
